package config;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Service;

import com.fasterxml.jackson.databind.ObjectMapper;

@Aspect
@Service
public class MyAop {
	//@Around("execution(* service.BookService.getBookById(..))")
	//@Around("execution(* controller.UserController.getUser(..))")
	@Around("execution(* com.mangofactory.swagger.controllers.DefaultSwaggerController.getApiListing(..))")
	public Object getResourceList(ProceedingJoinPoint pjp) throws Throwable {
		Object o = pjp.proceed();
		ObjectMapper om = new ObjectMapper();
		String jacksonStr = om.writeValueAsString(o);
		return o;
	}
}
